﻿namespace memo.entity.VO; 

public class Result<T> {
    public int? Code { get; set; }
    public string? Message { get; set; }
    public T? Data { get; set; }


    public Result(int? code, string? message, T? data) {
        this.Code = code;
        this.Message = message;
        this.Data = data;
    }
    public Result() {}
    
    
    public static Result<T> Success() {
        return new Result<T>(1, "success", default);
    }
    public static Result<T> Success(T? data) {
        return new Result<T>(1, "success", data);
    }
    
    public static Result<T> Fail(string? message) {
        return new Result<T>(0, message, default);
    }
    
}